import java.util.Arrays;

public class Test {
    public static void main(String[] args) {


    }
  public static int[] exchange(int[] array) {
      int len = array.length - 1;
      while (len >= 0) {
          if (array[len] != 9) {
              array[len]++;
              break;
          }
          array[len--] = 0;
      }


      if (len < 0) {
          int[] arr = new int[array.length + 1];
          arr[0]++;
          return arr;
      }

      return array;
  }
}
